//
//  huoDongTableViewCell.m
//  spotrs
//
//  Created by xu on 16/5/11.
//  Copyright © 2016年 TZ. All rights reserved.
//

#import "huoDongTableViewCell.h"

@implementation huoDongTableViewCell
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self craeatView];
    }
    return  self;
}
-(void)craeatView
{
    UIImageView *image = [[UIImageView alloc] initWithFrame:CGRectMake(15, 10, 5, 15)];
    [image setBackgroundColor:[UIColor orangeColor]];
    [self addSubview:image];
    
    UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(25, 10, 80, 15)];
    [lable setFont:[UIFont systemFontOfSize:14]];
    [lable setText:@"热门活动"];
    [lable setTextAlignment:NSTextAlignmentCenter];
    [self addSubview:lable];
    
    for (int i = 0; i<4; i++) {
        [self creatIcon:i];
    }
    
}
-(void)creatIcon:(int)number
{
    
    UIView *back = [[UIView alloc] initWithFrame:CGRectMake(15+number*(SCREEN_WIDTH-30)/4, 30, (SCREEN_WIDTH-30)/4, (SCREEN_WIDTH-30)/4+20)];
    [self addSubview:back];
    UIImageView *image = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, (SCREEN_WIDTH-30)/4, (SCREEN_WIDTH-30)/4)];
    [image setBackgroundColor:[UIColor redColor]];
    [back addSubview:image];
    
    UILabel *name = [[UILabel alloc] initWithFrame:CGRectMake(0,(SCREEN_WIDTH-30)/4 , (SCREEN_WIDTH-30)/4, 20)];
    [name setText:@"1111"];
    [name setTextAlignment:NSTextAlignmentCenter];
    [name setFont:[UIFont systemFontOfSize:12]];
    [back addSubview:name];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
